home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI O2 Out of Box Experience
/
SGI O2 Out of Box Experience.iso
/
cgi-bin
/
nph-startSysSetup.cgi
< prev
next >
Wrap
Text File
|
1996-11-14
|
6KB
|
160 lines
#!/bin/sh
#**************************************************************************
#* *
#* Copyright (c) 1993 Silicon Graphics, Inc. *
#* All Rights Reserved *
#* *
#* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI *
#* *
#* The copyright notice above does not evidence any actual of intended *
#* publication of such source code, and is an unpublished work by Silicon *
#* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
#* the property of Silicon Graphics, Inc. Any use, duplication or *
#* disclosure not specifically authorized by Silicon Graphics is strictly *
#* prohibited. *
#* *
#* RESTRICTED RIGHTS LEGEND: *
#* *
#* Use, duplication or disclosure by the Government is subject to *
#* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in *
#* Technical Data and Computer Software clause at DFARS 52.227-7013, *
#* and/or in similar or successor clauses in the FAR, DOD or NASA FAR *
#* Supplement. Unpublished - rights reserved under the Copyright Laws of *
#* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N. *
#* Shoreline Blvd., Mountain View, CA 94039-7311 *
#**************************************************************************
DISPLAY=:0.0
export DISPLAY
# First thing, check to see if we've already started System Setup
# If so, exit. If not, continue on.......
# Note that this is very specific, so if the calling string changes,
# we must change this conditional as well.
found=`/sbin/ps -ef | grep "/usr/bin/X11/netscape -xrm .netscape.Navigator.form.pane.leftOffset:" | grep -v grep `
if [ -n "$found" ]; then
/usr/bin/X11/xconfirm -c -B "OK" -icon progress \
-font '-*-helvetica-medium-r-narrow--19-*-*-*-p-83-iso8859-1' \
-t "System Setup has already been started..." > /dev/null
exit
fi
server_protocol=$SERVER_PROTOCOL;
server_software=$SERVER_SOFTWARE;
/sbin/echo "$server_protocol 200 OK"
/sbin/echo "Server: $server_software"
/sbin/echo "Content-Type: text/html\n\n";
# Print header
/sbin/echo "<html>\n";
/sbin/echo "<body bgcolor=#000000 text=#996688>\n";
/sbin/echo "<PRE>\n";
/sbin/echo "</PRE>\n";
/sbin/echo "<h2> Starting System Setup...</h2>\n";
/sbin/echo "<P>\n";
/sbin/echo " <FONT SIZE="3">It may take up to 30 seconds to start this tool.</FONT>\n";
/sbin/echo "<BR>\n";
/sbin/echo " <FONT SIZE="3">Please be patient.</FONT>\n";
/sbin/echo "</P>\n";
/sbin/echo "</body>\n";
/sbin/echo "</html>\n";
# Because we are starting from CGI, we need to reset the
# $HOME so that Netscape can find the preferences file and
# cache directory.
HOME=/tmp/.sset; export HOME
TMPDIR=/tmp; export TMPDIR
# create the home directory
if [ ! -d $HOME ]; then
/sbin/mkdir $HOME
fi
# create the .netscape directory
if [ ! -d $HOME/.netscape ]; then
/sbin/mkdir $HOME/.netscape
fi
# create the .netscape/cache directory so we don't get told that it
# created one for us
if [ ! -d $HOME/.netscape/cache ]; then
/sbin/mkdir $HOME/.netscape/cache
fi
# Get OutOfBox's copy of the System Setup preferences file for us to use
/bin/cp /CDROM/misc/ssetPreferences $HOME/.netscape/preferences
/sbin/chown nobody.nobody $HOME/.netscape/preferences
# Get OutOfBox's plugin.list file - this cuts significant time off of startup
# Use OutOfBox's list becuase it will be current - it was just created...
/bin/cp /usr/people/OutOfBox/.netscape/plugin-list $HOME/.netscape/plugin-list
/sbin/chown nobody.nobody $HOME/.netscape/plugin-list
# The window size is 696x697, just FYI
# This is centered placement for a 1280x1024 display size
locn="+292+163"
# Before the user starts System Setup, get rid of the lock file so
# that we don't get an error next time we start. (Netscape only
# removes the lock when you quit via File->Exit.)
# The lock is actually a link, so we check for "-l"
if [ -l $HOME/.netscape/lock ]; then
/sbin/rm $HOME/.netscape/lock
fi
# Check to be sure that we have the correct Netscape version number
# in our preferences file; we don't want the customers to see
# the license agreement window...
/usr/people/OutOfBox/bin/netscapeVsn.pl nobody $HOME
# Above, the test to see if this app has already been launched depends
# on this string not changing. If this calling string *does* change,
# be sure to change the conditional at the top of the file as well.
# invoke Netscape w/out any menus, buttons, borders, status, etc.....
/usr/bin/X11/netscape \
-xrm ".netscape.Navigator.form.pane.leftOffset: -5" \
-xrm ".netscape.Navigator.form.pane.rightOffset: -5" \
-xrm ".netscape.Navigator.form.pane.bottomOffset: -5" \
-xrm ".netscape.Navigator.form.menuBar.topOffset: -35" \
-xrm ".netscape.Navigator.form.dashboard.bottomOffset: -80" \
-xrm ".netscape.Navigator.form.securityBar.topOffset: -10" \
-geometry $locn \
http://localhost/SysSetup/en_US/Base/SysStartup.html
# Print header
/sbin/echo "<html>\n";
/sbin/echo "<body onLoad='self.location=\"file:/CDROM/entryspace/off.html\"'>\n";
/sbin/echo "</body>\n";
/sbin/echo "</html>\n";
# After the System Setup has quit, clean up the temporary home directory
if [ -d $HOME ]; then
/bin/rm -rf $HOME
fi